package cn.wolfcode.luowowo.mgrsite.redisTimerPersistent;

import cn.wolfcode.luowowo.service.IStrateryStatisRedisService;
import cn.wolfcode.luowowo.service.ITravelStatisRedisService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class RedisDataPersistenceJob {
    @Reference
    private IStrateryStatisRedisService statisRedisService;

    @Reference
    private ITravelStatisRedisService travelStatisRedisService;

    //7天更新一次
    @Scheduled(cron = "0/20 0 0 1/7 * ? ")
    public void  redisPersistent(){
        statisRedisService.redisPersistent();
        travelStatisRedisService.redisPersistent();
        System.out.println("持久化成功----------------------------------------------");
    }
}
